package util;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class WebSpider {
    public static void main(String[] args) {
        String url = "http://home.meishichina.com/recipe.html";
        String html = MyHttpUtil.sendGet(url, "");
        //System.out.println(html);
        Document doc = Jsoup.parse(html);
        Elements lis = doc.select("#recipeindex_living ul li");
        for (Element li : lis) {
            String img = li.select("a i .imgLoad").attr("src");
            // System.out.println(img);
            String name = li.select("a p").text();
            //System.out.println(name);
            String detailUrl = li.select("a").attr("href");
            String detailHtml = MyHttpUtil.sendGet(detailUrl, "");
            Document detailDoc = Jsoup.parse(detailHtml);
            Elements step=detailDoc.select(".recipeStep");

        }
    }
}
